package 力扣日常刷题.木22二月.第11天217;

import 力扣日常刷题.ListNode;

/**
 * @author 帅小伙
 * @date 2022/2/17
 * @description
 */
public class Demo74反转链表迭代 {



    public ListNode reverseList(ListNode head) {
        ListNode pre  = null,cur = head;

        while(cur!= null) {
            ListNode next = cur.next;
            cur.next = pre;
            pre = cur;
            cur = next;
        }
        return pre;
    }
}
